<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JS变量</title>

    <script>
      //定义变量
      var a = 3;
      /*alert(3);

      a = "abc"
      alert(a)*/

      //定义 number 类型
      var num1 = 1;
      var num2 = 1.2;
      var num3 = NaN;

      //输出到页面上
      document.write(num1+"<br>");
      document.write(num2+"<br>");
      document.write(num3+"<br>");

      //定义 string 类型
      var str = "abc";
      var str2 = 'edf';

      document.write(str+"<br>");
      document.write(str2+"<br>");

      //定义 boolean
      var flag = true;
      document.write(flag);

      //定义 null
      var obj = null;
      var obj2 = undefined;
      var obj3;
      document.write(obj+"<br>");
      document.write(obj2+"<br>");
      document.write(obj3+"<br>");


    </script>
</head>
<body>

</body>
</html>